<template>
	<view>
		<view class="user-section">
			<image class="bg" src="https://image.szcits.cn/Public/App/image/Slice 12@2x.png" mode=""></image>
		
			<view class="tui-header-center" :style="{top:tops+'rpx'}"  @click="navTo('/package_me/pages/userinfo/userinfo')">
				<image :src="data.pic?data.pic:'https://image.szcits.cn/Public/App/image/user.png'" class="tui-avatar" mode="aspectFill">
				</image>
				<view class="tui-info">
					<view class="tui-nickname">
						{{data.username||data.phone||"周艨"}}
						<text class="tui-img-move iconfont icon-xiangyoujiantou"></text>
					</view>
					<view class="tui-explain">普通用户</view>
				</view>
			</view>
		</view>
		
		<view class="cover-container">
			<view class="ul-section">
				<view class="list-cell" @click="navTo('/')">
					<!-- <image class="cell-icon" src="https://image.szcits.cn/Public/App/image/Slice 22@2x.png"></image> -->
					<text class="cell-tit">我的收藏</text>
					<text class="cell-more yticon icon-you iconfont icon-xiangyoujiantou"></text>
				</view>
				<view class="list-cell" @click="navTo('/')">
					<!-- <image class="cell-icon" src="https://image.szcits.cn/Public/App/image/Slice 23@2x.png"></image> -->
					<text class="cell-tit">我的帖子</text>
					<text class="cell-more yticon icon-you iconfont icon-xiangyoujiantou"></text>
				</view>
			</view>
			
			<view class="ul-section">
				<view class="list-cell" @click="navTo('/')">
					<!-- <image class="cell-icon" src="https://image.szcits.cn/Public/App/image/Slice 22@2x.png"></image> -->
					<text class="cell-tit">小组</text>
					<text class="cell-more yticon icon-you iconfont icon-xiangyoujiantou"></text>
				</view>
				<view class="list-cell" @click="navTo('/')">
					<!-- <image class="cell-icon" src="https://image.szcits.cn/Public/App/image/Slice 23@2x.png"></image> -->
					<text class="cell-tit">账号管理</text>
					<text class="cell-more yticon icon-you iconfont icon-xiangyoujiantou"></text>
				</view>
			</view>
			
		</view> 
		
		<view class="" style="height: 120rpx;"></view>
		
		<tabbar :index="3"></tabbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '我的',
				top: 0,
				height: 64,
				tops: 120,
				data: {},
			}
		},
		onLoad(){
			this.getInfo();
			let obj = {};
			obj = wx.getMenuButtonBoundingClientRect();
			setTimeout(() => {
				uni.getSystemInfo({
					success: (res) => {
						this.height = obj.top ? (obj.top + obj.height + 8) : (res.statusBarHeight +
							44);
						this.top = obj.top ? (obj.top + (obj.height - 32) / 2) : (res
							.statusBarHeight);
						// #ifdef MP
						this.tops = this.top + this.height + 15
						// #endif
					}
				})
			}, 100)
		},
		methods: {
			// 请求用户数据
			async getInfo(){
				// let res = await ({token:123});
				// this.data = res.data
				
			},
			navTo(url) {
				uni.navigateTo({
					url
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
page {
		background-color: #f7f8fa;
	}

	.user-section {
		position: relative;
		height: 600rpx;
		margin-bottom: -300rpx;

		.bg {
			position: absolute;
			left: 0;
			top: 0;
			width: 100%;
			height: 100%;
			filter: blur(2rpx);
			opacity: .7;
		}
	}


	.cover-container {
		margin: 0 30rpx;
		margin-top: -40rpx;
		position: relative;
		padding-bottom: 20rpx;
		min-height: 160rpx;
		box-sizing: border-box;

		.ul-section {
			border-radius: 16rpx;
			background: #fff;
			margin-bottom: 20rpx;

			.list-cell {
				display: flex;
				-webkit-box-align: baseline;
				-webkit-align-items: baseline;
				-ms-flex-align: baseline;
				align-items: baseline;
				padding: 20rpx 30rpx;
				line-height: 60rpx;
				position: relative;

				.cell-icon {
					align-self: center;
					width: 32rpx;
					max-height: 32rpx;
					font-size: 38rpx;
					margin-right: 20rpx;
				}

				.cell-more {
					align-self: center;
					font-size: 30rpx;
					color: #999999;
					margin-left: 20rpx;
				}

				.cell-tit {
					flex: 1;
					font-size: 28rpx;
					color: #303133;
					margin-right: 10rpx;
				}
			}
		}
	}

	.tui-header-center {
		position: absolute;
		width: 100%;
		height: 128rpx;
		left: 0;
		top: 120rpx;
		padding: 0 30rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
	}

	.tui-avatar {
		flex-shrink: 0;
		width: 128rpx;
		height: 128rpx;
		display: block;
		border-radius: 50%;
		border: 4rpx solid #fff;
		box-sizing: border-box;
	}

	.tui-info {
		width: 70%;
		padding-left: 30rpx;

	}

	.tui-nickname {
		font-size: 30rpx;
		font-weight: 500;
		color: #333;
		display: flex;
		align-items: center;
	}

	.tui-img-move {
		// width: 12rpx;
		// height: 22rpx;
		margin-left: 12rpx;
		font-size: 24rpx;
		font-weight: bold;
	}

	.tui-explain {
		width: 80%;
		font-size: 24rpx;
		font-weight: 400;
		color: #333;
		padding-top: 8rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}



	.order-section {
		position: absolute;
		left: 30rpx;
		right: 30rpx;
		top: 300rpx;
		padding: 28rpx 0;
		display: flex;
		justify-content: space-around;
		align-content: center;
		background: #fff;
		border-radius: 10rpx;

		.order-item {
			font-size: 28rpx;
			color: #333;
		}

		.order-text {
			font-size: 24rpx;
			color: #333333;
		}

		.yticon {
			width: 95rpx;
			height: 95rpx;
			font-size: 48rpx;
			margin: 0 auto;
			margin-bottom: 18rpx;
			display: block;
			// border: 2rpx solid #ebebeb;
			// border-radius: 50%;
			position: relative;
			display: flex;
			align-items: center;
			justify-content: center;

			image {
				// width: 40rpx;
				// max-height: 40rpx;
				width: 100%;
				height: 100%;
			}

			.number {
				font-size: 24rpx;
				background: #ff7f66;
				height: 28rpx;
				line-height: 28rpx;
				padding: 0 10rpx;
				border-radius: 14rpx;
				position: absolute;
				top: 0;
				right: 0;
				color: #fff;
			}
		}

	}
</style>
